<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>确认订单</title>
    <link rel="icon" type="image/x-icon" href="/images/速康logo.jpg" >
    <link rel="stylesheet" href="/stylesheets/order.css"/>
    <script src="/javascripts/jquery-3.1.0.min.js"></script>
    <script type="text/javascript" src="http://api.map.baidu.com/api?v=2.0&ak=2.0&ak=H9G5X4tyPuhvHosMGue3B4RcImb2ZOod"></script>
    <script>
        $(function(){
            $.get("/users/Session",function(data,status){
                console.log("数据: " + data + "\n状态: " + status);
                $("#UserInfo").html(data);
            });


            $(".classAdressAll").click(function(){
                $(".classAdressAll").css({"border":"4px solid #d3d3d3"})
                $(this).css({"border":"4px solid #a3a3a3"})
            })
        })


    </script>
</head>
<body>

    <div id="top">
        <div id="left">
            当前位置  <div id="demo">[正在定位..]</div>
            <div id="allmap"></div>
    </div>
    <div id="right">
            <ul>
                <div class="right1"><span id="UserInfo"></span>&nbsp;</div>
                <div class="right2">
                    <li><a href="/goods/UserOrder">我的订单</a> |</li>
                    <li><a href="/users/ShowUser">个人中心 |</a></li>
                    <li><a href="/Help">帮助中心</a> |</li>
                    <!--<li style="color:#C7A875">400-007-1234 |</li>-->
                    <li>手机APP |</li>
                    <li><a href="/users/glyLogin">管理员</a></li>
                </div>
            </ul>
        </div>
    </div>

    <div id="menu1">
        <div id="div1">
            <a href="/"> <img src="/images/速康logo.jpg" alt="" style="width: 80px;height: 80px"></a></div>
        <div id="div2"> | </div>
        <div id="div3"> 速康送药<br>您身边的<br>健康专家！</div>
        <a href="/goods/searchGood">
            <div id="div4"><input type="text" placeholder="   &nbsp请输入商品名"
                                  style="width: 380px;height: 40px;border:2px solid #0CA2DE;font-size: 14px;"></div>
            <div id="div5"><img src="/images/search.png"
                                style="padding-left: 18px;padding-top: 11px;width: 20px;height: 20px;"></div></a>
        <div id="div6">
            <div style="float: left;padding-top: 20px;"><img src="/images/电话.png" alt=""></div>
            <div style="float: left;margin-top: -5px;"><P style="font-size: 20px">400-010-1234 选药品<br><b>60</b>分钟内免费送到家</P></div>
        </div>
    </div>
    <hr>
    <h3 style="margin-left: 245px">选择收货地址</h3>
    <form id="frmUploadFile" action="/goods/sendOrder" method='post'>
        <div class="address">
            <div id="address1">
                <% if(OrderAddress.length > 0){ %>
                <% for(var q = 0;q < OrderAddress.length;q++) { %>
                <div id="address2" class="classAdressAll">
                    <span style="display: block; margin-top: 15px">收货人：<%= OrderAddress[q].UserName %> </span><br/>
                    <span style="display: block">电话：<%= OrderAddress[q].Tel %></span><br/>
                    <span style="display: block">地址：<%= OrderAddress[q].Address %></span>

                </div>
                <% } %>
                <input type="hidden" name="UserId" id="UserId" value="<%= OrderAddress[0].UserId %>"/>
                <input type="hidden" name="UserName" id="UserName" value="<%= OrderAddress[0].UserName %>"/>
                <input type="hidden" name="Tel" id="Tel" value="<%= OrderAddress[0].Tel %>"/>
                <input type="hidden" name="Address" id="Address" value="<%= OrderAddress[0].Address %>"/>
                <% } %>
            </div>
            <div style="margin: 15px 0 25px 5px"><a href="/goods/AddAddress" style="text-decoration: none">添加收货地址</a></div>
        </div>
        <hr style=" width: 850px;margin-bottom: 30px;">

        <h3 style="margin-left: 245px">确认订单信息</h3>
        <table style="margin: auto;margin-bottom: -20px">
            <thead>
            <tr>
                <th style="width: 50%">商品名称</th>
                <th>单价</th>
                <th>数量</th>
                <th>小计</th>
            </tr>
            </thead>
        </table>
        <table id="cartTable" style="margin: 0 auto">
            <thead style="display:none">
            <!--<tr>-->
            <!--<th>商品名称</th>-->
            <!--<th>单价</th>-->
            <!--<th>数量</th>-->
            <!--<th>小计</th>-->
            <!--</tr>-->
            </thead>
            <br>
            <% if(OrderGoods.length > 0){ %>
            <tbody>
            <% for(var s = 0, k = 0, v = 0, i = 0;i < OrderGoods.length;i++) { %>
            <tr>
                <td class="goods">
                    <a style="text-decoration: none" href="/goods/GoodsDetail?GoodsId=<%= OrderGoods[i].GoodsId %>">
                        <img width="50px" height="50px" align="center" src="/upload/<%= OrderGoods[i].Pic %>" alt="">
                        <%= OrderGoods[i].GoodsName %> </a></td>
                <td class="price"><%= OrderGoods[i].Price %>元/盒</td>
                <td class="count">
                    <%= OrderGoods[i].Count %>
                    <% v = v + OrderGoods[i].Count %>
                </td>
                <% k = OrderGoods[i].Count * OrderGoods[i].Price %>
                <td class="subtotal">￥<%= k %></td>

                <!--<td class="operation"><span class="delete">删除</span></td>-->
                <% s = s + k %>
            </tr>
            <input type="hidden" name="Price" id="Price" value="<%= OrderGoods[i].Price %>"/>
            <input type="hidden" name="Count" id="Count" value="<%= OrderGoods[i].Count %>"/>
            <input type="hidden" name="GoodsId" id="GoodsId" value="<%= OrderGoods[i].GoodsId %>"/>
            <input type="hidden" name="GoodsName" id="GoodsName" value="<%= OrderGoods[i].GoodsName %>"/>


            <% } %>
            </tbody>
        </table>
        <div class="foot" id="foot" style="margin: 0 auto">
            <div class="total">合计：￥<%= s %></div>
            <div class="closing">
               <input id="submitBtn" type="submit" value="提交订单"/>

            </div>
            <input type="hidden" name="OrderNumber" id="OrderNumber" value="<%= OrderGoods[0].OrderNumber %>"/>
            <% } %>
        </div>
    </form>
<div id="foo">
    <div class="footMin1" style="margin-left: 105px">
        <img src="/images/foot1.png" alt="" width="220" height="130"/>
    </div>
    <div class="footMin1">
        <img src="/images/foot2.png" alt="" width="220" height="130"/>
    </div>
    <div class="footMin1">
        <img src="/images/foot3.png" alt="" width="220" height="130"/>
    </div>
    <div class="footMin1">
        <img src="/images/foot4.png" alt="" width="220" height="130"/>
    </div>
</div>

<footer>
    关于我们丨 友情链接丨 联系我们丨 诚聘英才丨 帮助中心丨 <br/>
    苏州市公安局备案编号110105014669丨苏ICP备14030992号丨互联网药品信息服务资格证编号（苏)-非经营性-2016-0912 <br/>
    Copyright @ 2014-2016 速康送药 4000000511.com版权所有
</footer>

</body>
</html>
<script type="text/javascript">
    // 百度地图API功能
    var map = new BMap.Map("allmap");
    var point = new BMap.Point(116.331398,39.897445);
    map.centerAndZoom(point,12);

    function myFun(result){
        var cityName = result.name;
        map.setCenter(cityName);
        document.getElementById('demo').innerHTML='['+cityName+']';
    }
    var myCity = new BMap.LocalCity();
    myCity.get(myFun);
</script>
